using Eno.Domain.Entity.App;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Eno.Infrastructure.Configurations;

public class AppRoleConfiguration : IEntityTypeConfiguration<AppRole>
{
    public void Configure(EntityTypeBuilder<AppRole> builder)
    {

        builder.ToTable("app_roles");
        builder.HasMany(r => r.Permissions).WithMany(p => p.Roles).UsingEntity(j => j.ToTable("app_roles_permissions"));
    }
}